let mut lib_names = HashSet::new();
let mut bin_names = HashSet::new();
if options.compile_opts.spec.is_none() {
- for target in package.targets() {
+ for target in package.targets().iter().filter(|t| t.documented()) {
if target.is_lib() {
assert!(lib_names.insert(target.name()));
} else {
{compiling} a v0.0.1 (file://[..])
", compiling = COMPILING).as_slice()));
});
+
+test!(doc_same_name {
+ let p = project("foo")
+ .file("Cargo.toml", r#"
+ [package]
+ name = "foo"
+ version = "0.0.1"
+ authors = []
+ "#)
+ .file("src/lib.rs", "")
+ .file("src/bin/main.rs", "fn main() {}")
+ .file("examples/main.rs", "fn main() {}")
+ .file("tests/main.rs", "fn main() {}");
+
+ assert_that(p.cargo_process("doc"),
+ execs().with_status(0));
+});